# Java RIBClient
PROJECT (JavaRIBClient)

# FIND_PACKAGE ( SWIG REQUIRED )
# INCLUDE( UseSWIG )

INCLUDE(FindJava)
INCLUDE(FindJNI)
INCLUDE_DIRECTORIES(${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
# INCLUDE_DIRECTORIES($ENV{JAVA_INCLUDE} )

INCLUDE_DIRECTORIES ( . )
INCLUDE_DIRECTORIES ( ./../utils )
INCLUDE_DIRECTORIES ( $ENV{CPPUNIT_ROOT}/include )
INCLUDE_DIRECTORIES ( $ENV{OPENEXR_ROOT}/include )
INCLUDE_DIRECTORIES ( $ENV{ILMBASE_ROOT}/include )
INCLUDE_DIRECTORIES ( $ENV{DELIGHT}/include )

LINK_DIRECTORIES ( $ENV{CPPUNIT_ROOT}/lib )
LINK_DIRECTORIES ( $ENV{OPENEXR_ROOT}/lib )
LINK_DIRECTORIES ( $ENV{ILMBASE_ROOT}/lib )
LINK_DIRECTORIES ( $ENV{DELIGHT}/lib )
# LINK_DIRECTORIES ( ./../utils )

ADD_DEFINITIONS ( -DDELIGHT -DDELIGHT_RIBCLIENT )

SET_SOURCE_FILES_PROPERTIES( RIBClient.i PROPERTIES CPLUSPLUS ON)
SET_SOURCE_FILES_PROPERTIES( RIBClient.i PROPERTIES SWIG_FLAGS "-includeall")

IF (APPLE)
  # SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS "-dynamiclib -headerpad_max_install_names")
ENDIF (APPLE)

SWIG_ADD_MODULE ( ribclient java RIBClient.i ParameterList.cpp )
SWIG_LINK_LIBRARIES ( ribclient utils 3delight )

SET_TARGET_PROPERTIES ( ribclient PROPERTIES
  PREFIX "lib"
  )

IF (APPLE)
  SET_TARGET_PROPERTIES ( ribclient PROPERTIES SUFFIX ".jnilib")
ENDIF (APPLE)

